/**************************************************************************
** Qt Creator license header template
**   Special keywords: Programmer 2012/3/22 2012
**   Environment variables: 
**   To protect a percent sign, use '%'.
**************************************************************************/

#include "dialogquadricparams.h"
#include "ui_dialogquadricparams.h"

DialogQuadricParams::DialogQuadricParams(int nFaces,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogQuadricParams)
{
    ui->setupUi(this);
    //ui->errEdit->setText(tr("0.3"));
    ui->targetFaceNum->setText(QString::number(nFaces));
}

DialogQuadricParams::~DialogQuadricParams()
{
    delete ui;
}

void DialogQuadricParams::getParams(vcg::tri::TriEdgeCollapseQuadricParameter& params, int& targetFaceNum)
{
    targetFaceNum = (ui->targetFaceNum->text()).toInt();
    params.QualityThr = (ui->qualityThrd->text()).toFloat();
    params.PreserveBoundary = ui->BoundaryPres->isChecked();
    params.BoundaryWeight *= (ui->boundaryWeight->text()).toFloat();
    params.PreserveTopology = ui->TopoPresBox->isChecked();
    params.NormalCheck = ui->nomalCheckBox->isChecked();
    params.OptimalPlacement = ui->optimalPlacement->isChecked();
    params.QualityQuadric = ui->planarSimp->isChecked();

}
